//
//  City.swift
//  SwiftWeather
//
//  Created by shen on 2023/8/28.
//

import Foundation

struct City: Codable, Equatable {
    let id: Int?
    let name: String?
    let region: String?
    let country: String?
    let lat: Double?
    let lon: Double?
    let url: String?
}

extension City {
    var coordinate: Coordinate? {
        guard let lat, let lon else { return nil }
        return (lat, lon)
    }
}
